package cn.cxyxj.code_auth_jwt_persistence_prod.service.impl;


import cn.cxyxj.code_auth_jwt_persistence_prod.entity.OauthClientDetails;
import cn.cxyxj.code_auth_jwt_persistence_prod.mapper.OauthClientDetailsMapper;
import cn.cxyxj.code_auth_jwt_persistence_prod.service.IOauthClientDetailsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.Collections;
import java.util.List;

/**
 * 客户端 服务实现类
 * @author cxyxj
 * @since 2023-03-06
 */
@Service
public class OauthClientDetailsServiceImpl extends ServiceImpl<OauthClientDetailsMapper, OauthClientDetails> implements IOauthClientDetailsService {


    @Override
    public List<OauthClientDetails> queryClientIds(List<String> clientIds) {
        if(CollectionUtils.isEmpty(clientIds)){
            return Collections.emptyList();
        }
        List<OauthClientDetails> list = lambdaQuery().in(OauthClientDetails::getClientId, clientIds).list();
        return list;
    }
}

